blob: 415f4f0b303da22e9eec19c1b9e24732a74ecf67 [file] [log] [blame]
Junio C Hamano1a4e8412005-12-27 08:17:231git-rev-list(1)
2===============
3
4NAME
5----
6git-rev-list - Lists commit objects in reverse chronological order
7
8
9SYNOPSIS
10--------
Junio C Hamano235a91e2006-01-07 01:13:5811[verse]
Junio C Hamanod2179ef2010-10-22 04:12:1712'git rev-list' [ \--max-count=<number> ]
13 [ \--skip=<number> ]
14 [ \--max-age=<timestamp> ]
15 [ \--min-age=<timestamp> ]
Junio C Hamano235a91e2006-01-07 01:13:5816 [ \--sparse ]
Junio C Hamano934e1782009-07-16 06:59:1517 [ \--merges ]
Junio C Hamano235a91e2006-01-07 01:13:5818 [ \--no-merges ]
Junio C Hamanof32ce262011-03-27 07:35:1119 [ \--min-parents=<number> ]
20 [ \--no-min-parents ]
21 [ \--max-parents=<number> ]
22 [ \--no-max-parents ]
Junio C Hamano554da792007-12-27 03:29:5823 [ \--first-parent ]
Junio C Hamano9be18972006-01-28 08:54:5724 [ \--remove-empty ]
Junio C Hamanoee695f22007-06-21 00:35:3625 [ \--full-history ]
Junio C Hamano872c5682006-07-07 06:05:4026 [ \--not ]
Junio C Hamano235a91e2006-01-07 01:13:5827 [ \--all ]
Junio C Hamanod2179ef2010-10-22 04:12:1728 [ \--branches[=<pattern>] ]
29 [ \--tags[=<pattern>] ]
30 [ \--remotes[=<pattern>] ]
31 [ \--glob=<glob-pattern> ]
Junio C Hamanoc9245d92006-09-06 09:35:4632 [ \--stdin ]
Junio C Hamano8c5802d2007-11-15 00:13:3633 [ \--quiet ]
Junio C Hamanodecf50e2006-03-05 10:51:1434 [ \--topo-order ]
Junio C Hamano235a91e2006-01-07 01:13:5835 [ \--parents ]
Junio C Hamanoee695f22007-06-21 00:35:3636 [ \--timestamp ]
Junio C Hamano5678d692007-04-06 00:51:4337 [ \--left-right ]
Junio C Hamano9a2fb2d2011-03-23 05:40:1538 [ \--left-only ]
39 [ \--right-only ]
40 [ \--cherry-mark ]
Junio C Hamanod9e0e5d2007-04-14 16:22:0441 [ \--cherry-pick ]
Junio C Hamano775a0f42006-12-31 01:19:1442 [ \--encoding[=<encoding>] ]
Junio C Hamano47c1e3c2006-09-25 04:45:5543 [ \--(author|committer|grep)=<pattern> ]
Junio C Hamanoa476efa2008-10-10 15:31:4244 [ \--regexp-ignore-case | -i ]
45 [ \--extended-regexp | -E ]
46 [ \--fixed-strings | -F ]
Junio C Hamanod2179ef2010-10-22 04:12:1747 [ \--date=(local|relative|default|iso|rfc|short) ]
Junio C Hamano5f327762006-03-02 09:14:5148 [ [\--objects | \--objects-edge] [ \--unpacked ] ]
Junio C Hamano235a91e2006-01-07 01:13:5849 [ \--pretty | \--header ]
50 [ \--bisect ]
Junio C Hamano20f64da2007-04-04 18:38:3051 [ \--bisect-vars ]
Junio C Hamano1974bf22007-10-31 05:57:2052 [ \--bisect-all ]
Junio C Hamano859f3b42006-08-04 10:04:3053 [ \--merge ]
Junio C Hamano053827f2007-02-14 07:23:5854 [ \--reverse ]
Junio C Hamanodb450ba2007-01-21 08:57:1455 [ \--walk-reflogs ]
Junio C Hamanoa196f6d2007-07-24 08:10:2756 [ \--no-walk ] [ \--do-walk ]
Junio C Hamano235a91e2006-01-07 01:13:5857 <commit>... [ \-- <paths>... ]
Junio C Hamano1a4e8412005-12-27 08:17:2358
59DESCRIPTION
60-----------
Junio C Hamano89e135d2006-09-03 06:18:2561
Junio C Hamano31cca162009-08-07 05:40:0162List commits that are reachable by following the `parent` links from the
63given commit(s), but exclude commits that are reachable from the one(s)
64given with a '{caret}' in front of them. The output is given in reverse
65chronological order by default.
Junio C Hamano1a4e8412005-12-27 08:17:2366
Junio C Hamano31cca162009-08-07 05:40:0167You can think of this as a set operation. Commits given on the command
68line form a set of commits that are reachable from any of them, and then
69commits reachable from any of the ones given with '{caret}' in front are
70subtracted from that set. The remaining commits are what comes out in the
71command's output. Various other options and paths parameters can be used
72to further limit the result.
73
74Thus, the following command:
Junio C Hamano89e135d2006-09-03 06:18:2575
76-----------------------------------------------------------------------
Junio C Hamanofce7c7e2008-07-02 03:06:3877$ git rev-list foo bar ^baz
Junio C Hamano89e135d2006-09-03 06:18:2578-----------------------------------------------------------------------
79
Junio C Hamano31cca162009-08-07 05:40:0180means "list all the commits which are reachable from 'foo' or 'bar', but
81not from 'baz'".
Junio C Hamano1a4e8412005-12-27 08:17:2382
Junio C Hamano89e135d2006-09-03 06:18:2583A special notation "'<commit1>'..'<commit2>'" can be used as a
84short-hand for "{caret}'<commit1>' '<commit2>'". For example, either of
85the following may be used interchangeably:
Junio C Hamano1a4e8412005-12-27 08:17:2386
Junio C Hamano89e135d2006-09-03 06:18:2587-----------------------------------------------------------------------
Junio C Hamanofce7c7e2008-07-02 03:06:3888$ git rev-list origin..HEAD
89$ git rev-list HEAD ^origin
Junio C Hamano89e135d2006-09-03 06:18:2590-----------------------------------------------------------------------
91
92Another special notation is "'<commit1>'...'<commit2>'" which is useful
93for merges. The resulting set of commits is the symmetric difference
Junio C Hamano872c5682006-07-07 06:05:4094between the two operands. The following two commands are equivalent:
95
Junio C Hamano89e135d2006-09-03 06:18:2596-----------------------------------------------------------------------
Junio C Hamanofce7c7e2008-07-02 03:06:3897$ git rev-list A B --not $(git merge-base --all A B)
98$ git rev-list A...B
Junio C Hamano89e135d2006-09-03 06:18:2599-----------------------------------------------------------------------
100
Junio C Hamano27a128b2009-08-13 01:23:00101'rev-list' is a very essential git command, since it
Junio C Hamano89e135d2006-09-03 06:18:25102provides the ability to build and traverse commit ancestry graphs. For
103this reason, it has a lot of different options that enables it to be
Junio C Hamano1aa40d22010-01-21 17:46:43104used by commands as different as 'git bisect' and
105'git repack'.
Junio C Hamano1a4e8412005-12-27 08:17:23106
107OPTIONS
108-------
Junio C Hamano89e135d2006-09-03 06:18:25109
Junio C Hamanob0e02952008-01-19 08:02:00110:git-rev-list: 1
111include::rev-list-options.txt[]
Junio C Hamano0430e3a2007-05-15 03:13:17112
113include::pretty-formats.txt[]
114
Junio C Hamano1a4e8412005-12-27 08:17:23115GIT
116---
Junio C Hamanof7c042d2008-06-06 22:50:53117Part of the linkgit:git[1] suite